<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<link rel="stylesheet" type="text/css" href="../../../Themes/default/easyui.css">
		<link rel="stylesheet" type="text/css" href="../../../CSS/demo.css">
		<link rel="stylesheet" type="text/css" href="../../../Themes/icon.css">
		<link rel="stylesheet" type="text/css" href="../../../CSS/common.css">

	</head>

	<body style="padding: 0px;">
		<div class="easyui-layout" style="width:100%;height:600px;">
			<div data-options="region:'center'">
				<div>
					<table id="dg" style="width: 100%;" class="table_style">
					</table>
				</div>
			</div>
		</div>
		<div id="toolbar"></div>
		<div id="dlg" class="hiddenDialog">
			<iframe id="ifrmEdit" style="width: 100%;height: 100%;" frameborder="0" scrolling="no"></iframe>
		</div>
	</body>
	<script type="text/javascript" src="../../../JS/jquery.min.js"></script>
	<script type="text/javascript" src="../../../JS/jquery.easyui.min.js"></script>
	<script type="text/javascript" src="../../../JS/common.js"></script>
	<script>
		var currid = getID(); /**得到当前界面的ID**/
		var content = ""; /*定义一个空的content*/
		var AddDialog;
		content = AddToolBar(35);
		$("#toolbar").append(content); /*在ID=toolbar的标记后面添加content中的内容*/

		/*添加信息*/
		function newdata() {
			AddTabIn("订单管理", parent.parent.$('#tabs'), "UI/LOGISTICS/OriginalOrder/OriginalOrderAdd.html?id=-1");
		}

		/*编辑信息*/
		function editdata() {
			var pLocation = "";
			var row = $('#dg').datagrid('getSelected');
			if(!row) {
				$.messager.alert('Info', "请选择你需要修改数据"); /*判断是否有行被选中，如果没有，则弹出警告框，提示用户修改数据*/
				return;
			}
			AddTabIn("原始订单修改", parent.parent.$('#tabs'), "UI/LOGISTICS/OriginalOrder/OriginalOrderAdd.html?id=" + row.ID);
		}

		$('#dg').datagrid({
			url: RemoteLinkAddress + '/logistics/salesorder/list.do',
			toolbar: '#toolbar',
			method: 'get',
			pagination: 'true',
			rownumbers: 'true',
			autoRowHeight: 'true',
			singleSelect: 'true',
			fitColumns: 'false',
			height: 350,
			/*表格中的列名以及各自列名的ID*/
			columns: [
				[{
					field: 'ID',
					title: 'ID',
					width: '0%',
					align: 'center'
				}, {
					field: 'ORDER_NO',
					title: '订单编号',
					width: '13%',
					align: 'center'
				}, {
					field: 'CUSTOMER_TYPE',
					title: '用户组',
					width: '14%',
					align: 'center'
				}, {
					field: 'CUSTOMER_NAME',
					title: '配送单位名称',
					width: '14%',
					align: 'center'
				}, {
					field: 'DISTRIBUTION_DATE',
					title: '配送时间',
					width: '13%',
					align: 'center'
				}, {
					field: 'LUMP_SUM',
					title: '总价',
					width: '13%',
					align: 'center',
					formatter: function(value, row, index) {
						if(value) {
							return "￥" + value + "元";
						}
					}
				}, {
					field: 'STATE',
					title: '订单状态',
					width: "14%",
					align: 'center'
				}, {
					field: 'ISVERIFY',
					title: '审核状态',
					width: '14%',
					align: 'center',
					formatter: function(value, row, index) {
						return verifyStatus(value, false);
					}
				}]
			],
			onDblClickRow: function(index, row) {
				var pLocation = "";
				pLocation = "OriginalOrderTest.html?id=" + row.ID; /*将BoothManagementAdd.html的相对路径与被选中行的ID赋值给pLocation*/
				window.location = pLocation;
			}
		});
		$('#dg').datagrid('hideColumn', 'ID');

		function redodata() {
			checkAllData("/logistics/salesorder/list.do");
		}
	</script>

</html>